/**
 * 积分商城-商品详情
 */
'use strict';
import React, {
    Component
} from 'react'
import {
    hashHistory,
    Link
} from 'react-router'

import Header from './Common/Header'
import {
    Tips
} from '../Tools'


export default class Position extends Component {
    constructor(props) {
        super(props);
    }
    componentDidMount() {
        const {
            address,
            lng,
            lnt
        } = this.props.params
        if (lng == 'undefined' || lnt == 'undefined') {
            Tips('地址信息有误')
            return
        }
        var map = new AMap.Map('position', {
            resizeEnable: true,
            center: [lng, lnt],
            zoom: 13
        });
        var marker = new AMap.Marker({
            position: map.getCenter()
        });
        // map.clearMap();
        marker.setMap(map);

        // 设置label标签
        // marker.setLabel({
        //     // offset: new AMap.Pixel(0, -24),
        //     content: unescape(address)
        // });
    }

    render() {
        return (
            <div className="positionmap">
                <Header title={unescape(this.props.params.title)} />
                <div id='position'></div>
            </div>
        )
    }
}
